<?php
use \Workerman\Autoloader;

require_once __DIR__ . '/../../../../../Workerman/Autoloader.php';
require_once __DIR__.'/../../../Config/Const.php';
Autoloader::setRootPath(__DIR__.'/../../..');

$page_groupId = GROUP_NURSERY_STOCK_MN;
$page_pageId = PAGE_NURSERY_STOCK_SPECIES__LIST;

require "../framepages/moudle_base.php";

?>
<div class="main-content">
    <div>
        <table class="table" style="word-break:break-all">
            <tr>
                <th width="9%">花木id</th>
                <th width="12%">花木名称</th>
                <th width="12%">价格</th>
                <th width="12%">规格</th>
                <th width="12%">规格范围</th>
                <th width="12%">省</th>
                <th width="12%">市</th>
                <th width="12%">县/区</th>
                <th width="12%">年</th>
                <th width="12%">月</th>
            </tr>
            <?php
            $nursery_stock_goods_list = \Data\Nursery_stock_goods_DAO::getList();
            foreach ($nursery_stock_goods_list as $nursery_stock_goods_record) {
                $goods_id = $nursery_stock_goods_record->getGOODS_ID();
                $species_group_id = $nursery_stock_goods_record->getSPECIES_GROUP_ID();
                $goods_name = $nursery_stock_goods_record->getGOODS_NAME();
                $price = $nursery_stock_goods_record->getPRICE();

                $nursery_stock_species_group_record = \Data\Nursery_stock_species_group_DAO::getRecord($species_group_id);
                $species_group_name = $nursery_stock_species_group_record->getSPECIES_GROUP_NAME();
                $species_id = $nursery_stock_species_group_record->getSPECIES_ID();
                $nursery_stock_species_record = \Data\Nursery_stock_species_DAO::getRecord($species_id);
                $species_name = $nursery_stock_species_record->getSPECIES_NAME();



                echo "
                        <tr>
                            <td>$goods_id</td>
                            <td>$species_name</td>
                            <td>$price</td>
                            <td>$goods_name</td>
                            <td>$species_group_name</td>                                              
                            <td>$species_group_id</td>                                            
                        </tr>
                    ";
            }
            ?>


        </table>
    </div>
    <?php
    require "../framepages/footer.php";
    ?>
</div>
</div>
<script src="../lib/bootstrap/js/bootstrap.js"></script>
</body>
</html>
